
#obj-m	:= glink-class.o
# 自己编写的驱动，用内核线程实现长按检测
#obj-m	:= s7611_ts.o
# obj-m	+= mxs-hsadc.o
# obj-m	+= mxs-hsadc2.o
# 按照厂家给的7寸驱动，不能识别按键长按
#obj-m	:= s7611_ts_7.o

#obj-m	:= touch-s.c.bak.o
# obj-m	:= ds2782_battery.o
#obj-m	:= max1720x.o
# obj-m	:= max1720x_battery.o
# obj-m	:= map.o
# obj-m	:= flexcan.o
obj-m	:= tk100-imx6-adc.o
# obj-m	:= netlink.o
# obj-m	+= tk100-red.o
# obj-m	+= tk100-red-imx6.o

#obj-m	+= devices.o
# obj-m	+= lcd-spi-nv3052c.o
#obj-m	+= ls2k-wdt-asm.o
#obj-m	+= ls2k-led.o
#obj-m   += ls2k-device.o
# obj-m   += spi-ls2k.o
#obj-m   += ls2k-gpio.o
# obj-m += platform.o
#obj-m += a.o b.o c.o
# obj-m   += wdt-work.o
#obj-m += mxs-ts.o
MODULE_INSTALDIR ?= /lib/modules/$(shell uname -r)/kernel/drivers/net/usb
KERNELDIR = /work/EasyArm/linux-2.6.35.3
#KERNELDIR = ~/home/work/EasyArm/linux-2.6.35.3/
KERNELDIR = /work/EasyArm/linux-imx/
#KERNELDIR = ~/home/work/dvd-loongson/linux-3.10-git
# KERNELDIR = /work/forlinx/linux-4.1.15
PWD       := $(shell pwd)


# 龙芯内核才使用否则在
# #include "linux/platform_device.h"
# 会出错code model kernel does not support PIC mode
#KBUILD_CFLAGS += -fno-pie
KBUILD_CFLAGS += -g

default:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) -j4 

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

install:
	# modprobe -r glink-class
	# install -c -m 0644 glink-class.ko $(MODULE_INSTALDIR)
	depmod -a -e

#depend .depend dep:
#	$(CC) $(CFLAGS) -M *.c > .depend


#ifeq (.depend,$(wildcard .depend))
#include .depend
#endif
